#ifndef BTFORM_H
#define BTFORM_H

#include <QPropertyAnimation>
#include <QWidget>

namespace Ui
{
    class btForm;
}

class btForm final : public QWidget
{
    Q_OBJECT

public:
    explicit btForm(QWidget *parent = nullptr);
    // 设置图标 文字 id
    void setIconAndText(const QString &btIcon, const QString &btText, int pageId = 0);
    // 获取页面ID
    int getPageId() const;
    // 清除背景
    void backGroundClear();
    // 设置线条动画
    void setupLineAnimation(QPropertyAnimation *animation, QWidget *line, int xPosition, int duration);
    // 显示/隐藏动画
    void showAnimal(bool is_show) const;

    ~btForm() override;

signals:
    void btClick(int id);

protected:
    // 鼠标标点击事件
    void mousePressEvent(QMouseEvent *event) override;

private:
    Ui::btForm *ui;
    int _pageId = 0; // 页面ID变量，用于标识当前页面
    QPropertyAnimation *line1Animal = nullptr;
    QPropertyAnimation *line2Animal = nullptr;
    QPropertyAnimation *line3Animal = nullptr;
    QPropertyAnimation *line4Animal = nullptr;
};

#endif // BTFORM_H
